<?php
!defined('P_W') && exit('Forbidden');
class PW_TypeDataRound {
	
	function getData($config) {
		$hid = (int)$config['hid'];
		if (!$hid) return array();
		$num = (int)$config['num'] ? (int) $config['num'] : 15;
		return $this->_getData($hid,$num);
	}
	
	function _getData($hid,$num) {
		$houseElement = House::loadClass('housesortelement');
		$result = array();
		$houseInfodb = House::loadDB('HouseInfo');
		$info = $houseInfodb->getInfoById($hid);
		//$temp = $houseElement->getRoundHousesByPosition($hid,$num);
		$temp = $houseElement->newHouse($info['area'], $num + 1, 'area', $hid);
		foreach ($temp as $key=>$value) {
			($value['hid'] != $hid) && $result[] = array('url'=>$value['url'],'name'=>$value['name'],'area'=>$value['area'],'aveprice'=>$value['aveprice']);
		}
		return $result;
	}
}
?>